package edu.gdut.thesissys.vo;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * AccreditationId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class AccreditationId extends BaseVo implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -1113752779572843265L;
	private String studentId;
	private String teacherId;

	// Constructors

	/** default constructor */
	public AccreditationId() {
	}

	/** full constructor */
	public AccreditationId(String studentId, String teacherId) {
		this.studentId = studentId;
		this.teacherId = teacherId;
	}

	// Property accessors

	@Column(name = "student_id", nullable = false, length = 10)
	public String getStudentId() {
		return this.studentId;
	}

	public void setStudentId(String studentId) {
		this.studentId = studentId;
	}

	@Column(name = "teacher_id", nullable = false, length = 10)
	public String getTeacherId() {
		return this.teacherId;
	}

	public void setTeacherId(String teacherId) {
		this.teacherId = teacherId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof AccreditationId))
			return false;
		AccreditationId castOther = (AccreditationId) other;

		return ((this.getStudentId() == castOther.getStudentId()) || (this
				.getStudentId() != null
				&& castOther.getStudentId() != null && this.getStudentId()
				.equals(castOther.getStudentId())))
				&& ((this.getTeacherId() == castOther.getTeacherId()) || (this
						.getTeacherId() != null
						&& castOther.getTeacherId() != null && this
						.getTeacherId().equals(castOther.getTeacherId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getStudentId() == null ? 0 : this.getStudentId().hashCode());
		result = 37 * result
				+ (getTeacherId() == null ? 0 : this.getTeacherId().hashCode());
		return result;
	}

}